<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增团长带回')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: jasny-bootstrap-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-teamYl-add">
            <h4 class="form-header h4" >团队编号信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">团队编号：</label>
                    <div class="col-sm-8">
                        <input name="teamYlId" class="form-control" th:value="${teamCode}"  type="text" required readonly>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4" >团长信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label  is-required">团长展业端管理编号：</label>
                    <div class="col-sm-8">
                        <input name="leaderAgentNum" onclick="selectTeamView()" readonly id="teamAgentNum" type="text" class="form-control" required>
                        <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">团长展业端管理名称：</label>
                    <div class="col-sm-8">
                        <input name="leaderAgentName" class="form-control" id="teamAgentName" type="text" required readonly>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4" >政策信息</h4>
            <div class="row">
                <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">引流奖励：</label>
                    <div class="col-sm-8">
                        <select name="policyYlId" class="form-control m-b">
                            <option value="">所有</option>
                            <option th:each="y:${yList}" th:text="${y.policyName}" th:value="${y.id}"></option>
                        </select>
                    </div>
                </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">返现奖励：</label>
                        <div class="col-sm-8">
                            <select name="policyFxId" class="form-control m-b">
                                <option value="">所有</option>
                                <option th:each="f:${fList}" th:text="${f.policyName}" th:value="${f.id}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">采购奖励：</label>
                        <div class="col-sm-8">
                            <select name="policyCgId" class="form-control m-b">
                                <option value="">所有</option>
                                <option th:each="c:${cList}" th:text="${c.policyName}" th:value="${c.id}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">增量奖励：</label>
                        <div class="col-sm-8">
                            <select name="policyZlId" class="form-control m-b">
                                <option value="">所有</option>
                                <option th:each="z:${zList}" th:text="${z.policyName}" th:value="${z.id}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
           <!-- <h4 class="form-header h4" >政策日期</h4>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">开始时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="startDate"  readonly class="form-control" placeholder="yyyy-MM-dd" type="text">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">结束时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="endDate"  readonly class="form-control" placeholder="yyyy-MM-dd" type="text">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>-->
            <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: jasny-bootstrap-js" />
    <script th:inline="javascript">
        var prefix = ctx + "team/teamYlInfo"
        $("#form-agentPosOperation-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-teamYl-add').serialize());
            }
        }

        $("input[name='startDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        /**
         * 选择服务商
         */
        function selectTeamView() {
            var url =prefix+ "/selectTeamView";
            $.modal.open("选择服务商" , url, '1100',"500");
        }


        /**
         * 选择本级级以下代理
         */
        function selectAgentInfoRecursiveData() {
            var agentNum = $("#applyAgentNum").val();
            if ($.common.isEmpty(agentNum)){
                $.modal.alertWarning("请选择申请资深总监");
                return;
            }
            var url =prefix+ "/selectAgentInfoList?agentNum="+agentNum;
            $.modal.open("选择下级服务商" , url, '1100',"500");
        }

    </script>
</body>
</html>